import 'package:flutter_bilibili/model/video_mo.dart';

class VideoDetailMo {
  late int like;
  late bool isLike;
  late bool isUnlike;
  late int coin;
  late int favorite;
  late bool isFavorite;
  late int share;
  late List<VideoMo> videoList;

  VideoDetailMo({
    required this.like,
    required this.isLike,
    required this.isUnlike,
    required this.coin,
    required this.favorite,
    required this.isFavorite,
    required this.share,
  });

  VideoDetailMo.fromJson(Map<String, dynamic> json) {
    like = json['like'];
    isLike = json['isLike'];
    isUnlike = json['isUnlike'];
    coin = json['coin'];
    favorite = json['favorite'];
    isFavorite = json['isFavorite'];
    share = json['share'];
    if (json['videoList'] != null) {
      videoList = new List<VideoMo>.empty(growable: true);
      json['videoList'].forEach((item) {
        videoList.add(new VideoMo.fromJson(item));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['like'] = this.like;
    data['isLike'] = this.isLike;
    data['isUnlike'] = this.isUnlike;
    data['coin'] = this.coin;
    data['favorite'] = this.favorite;
    data['isFavorite'] = this.isFavorite;
    data['share'] = this.share;
    if (this.videoList != null) {
      data['videoList'] = this.videoList.map((item) => item.toJson());
    }
    return data;
  }
}
